package com._5704.website.mapper;

import com._5704.website.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Yiyoung
 * @since 2021-07-25
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    List<User> getUsers(@Param("page")int page,@Param("num") int num);

    Date getLastLoginTime(String id);

    void setLastLoginTime(String id);

//    void updateUser(User user);

    void updateAuthority(@Param("id") String userId ,@Param("perms") int perms);

    int getNum();

    List<User> getUserByName(@Param("name")String name,@Param("page") int page,@Param("num") int num);

    int getSearchNum(String name);

    void updateAvatar(@Param("fileName")String dataBaseFileName,@Param("userId") String userId);
}
